/**
 * 
 */
package com.oet.webservice.business.data;

/**
 * @author y140zhan
 *
 */

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.activation.DataHandler;

import org.apache.cxf.aegis.type.java5.IgnoreProperty;

import com.oet.persistence.entity.Category;
import com.oet.persistence.entity.Course;
import com.oet.persistence.entity.CourseFile;
import com.oet.persistence.entity.CourseNews;
import com.oet.persistence.entity.CourseSeries;
import com.oet.persistence.entity.Customer;
import com.oet.persistence.entity.Teacher;
import com.oet.persistence.entity.UserComment;
import com.oet.persistence.entity.UserCourseSeries;
import com.oet.persistence.entity.UserHistoryCourse;
import com.oet.persistence.entity.UserPlannedCourse;

public final class WebserviceSoapHelper implements java.io.Serializable {
	
	  public static WebServiceCategory prepareWebCategory(Category instance)
	  {
		  WebServiceCategory result = new WebServiceCategory();
		  
		  result.setId(instance.getId());
		  result.setName(instance.getName());
		  
		  return result;
	  }
	  
	  public static Category prepareCategory(Category result, WebServiceCategory instance)
	  {
		  //We do not set the Id by default
		  //result.setId(instance.getId());
		  result.setName(instance.getName());
		  return result;
	  }
	  
	  public static WebServiceCourse prepareWebCourse(Course instance)
	  {
		  WebServiceCourse result = new WebServiceCourse();
		  result.setId(instance.getId());
		  result.setCourseSeriesId(instance.getCourseSeries().getId());
		  result.setChapterId(instance.getChapterId());
		  result.setName(instance.getName());
		  result.setType(instance.getType());
		  result.setLevel(instance.getLevel());
		  result.setPayFactor(instance.getPayFactor());
		  result.setTeacherId(instance.getTeacherId());
		  result.setTopic(instance.getTopic());
		  result.setDescription(instance.getDescription());
		  result.setCapacity(instance.getCapacity());
		  result.setOccupyNum(instance.getOccupyNum());
		  result.setDate(instance.getDate());
		  result.setDurationFactor(instance.getDurationFactor());
		  result.setLastModified(instance.getLastModified());
		  result.setScore(instance.getScore());
		  
		  result.setScoredNumber(instance.getScoredNumber());
		  result.setTopicPic(instance.getTopicPic());
		  /*
			private Long courseSeriesId;
		   * 
		   */
		  
		  
		  return result;
	  }
	  
	  public static Course prepareCourse(Course result, WebServiceCourse instance)
	  {
		  //We do not set the Id by default
		  //result.setId(instance.getId());
		  result.setChapterId(instance.getChapterId());
		  result.setName(instance.getName());
		  result.setType(instance.getType());
		  result.setLevel(instance.getLevel());
		  result.setPayFactor(instance.getPayFactor());
		  
		  result.setTeacherId(instance.getTeacherId());
		  result.setTopic(instance.getTopic());
		  result.setDescription(instance.getDescription());
		  result.setCapacity(instance.getCapacity());
		  result.setOccupyNum(instance.getOccupyNum());
		  
		  result.setDate(instance.getDate());
		  result.setDurationFactor(instance.getDurationFactor());
		  result.setLastModified(instance.getLastModified());
		  result.setScore(instance.getScore());
		  result.setScoredNumber(instance.getScoredNumber());
		  
		  return result;
	  }
	  
	  
	  public static WebServiceTeacher prepareWebTeacher(Teacher instance)
	  {
		  WebServiceTeacher result = new WebServiceTeacher();
		  
		  result.setId(instance.getId());
		  result.setName(instance.getName());
		  result.setEmail(instance.getEmail());
		  result.setMobilePhone(instance.getMobilePhone());
		  result.setLevel(instance.getLevel());
		  
		  result.setThumbnail(instance.getThumbnail());
		  result.setBirthday(instance.getBirthday());
		  result.setPayFactor(instance.getPayFactor());
		  result.setPassword(instance.getPassword());
		  result.setScore(instance.getScore());
		  
		  result.setScoredNumber(instance.getScoredNumber());
		  result.setTotalCourseNumber(instance.getTotalCourseNumber());
		  result.setMovie(instance.getMovie());
		  result.setIsActived(instance.getIsActived());
		  result.setLastAccessed(instance.getLastAccessed());
		  
		  result.setDescription(instance.getDescription());
		  
		  
		  /*
			private Long courseSeriesId;
		   * 
		   */
		  
		  
		  return result;
	  }
	  
	  public static Teacher prepareTeacher(Teacher result, WebServiceTeacher instance)
	  {
		  //We do not set the Id by default
		  //result.setId(instance.getId());
		  result.setName(instance.getName());
		  result.setEmail(instance.getEmail());
		  result.setMobilePhone(instance.getMobilePhone());
		  result.setLevel(instance.getLevel());
		  
		  result.setThumbnail(instance.getThumbnail());
		  result.setBirthday(instance.getBirthday());
		  result.setPayFactor(instance.getPayFactor());
		  result.setPassword(instance.getPassword());
		  result.setScore(instance.getScore());
		  
		  result.setScoredNumber(instance.getScoredNumber());
		  result.setTotalCourseNumber(instance.getTotalCourseNumber());
		  result.setMovie(instance.getMovie());
		  result.setIsActived(instance.getIsActived());
		  result.setLastAccessed(instance.getLastAccessed());
		  
		  result.setDescription(instance.getDescription());
		  
		  return result;
	  }
	  
	  
	  
	  
	  public static WebServiceCourseSeries prepareWebCourseSeries(CourseSeries instance)
	  {
		  WebServiceCourseSeries result = new WebServiceCourseSeries();
		  
		  result.setId(instance.getId());
		  if (instance.getCategory() != null)
		  {
			  result.setWebServiceCategory(prepareWebCategory(instance.getCategory()));
		  }
		  result.setName(instance.getName());
		  result.setLevel(instance.getLevel());
		  result.setCourseNumber(instance.getCourseNumber());
		  
		  if (instance.getTeacher() != null)
		  {
			  result.setTeacherId(instance.getTeacher().getId());
			  result.setTeacherName(instance.getTeacher().getName());
		  }
		  result.setCapacity(instance.getCapacity());
		  result.setOccupyNum(instance.getOccupyNum());
		  result.setStartDate(instance.getStartDate());
		  result.setEndDate(instance.getEndDate());
		  
		  result.setLastModified(instance.getLastModified());
		  result.setScore(instance.getScore());
		  result.setScoredNumber(instance.getScoredNumber());
		  result.setIsActived(instance.getIsActived());
		  result.setAttribute0(instance.getAttribute0());
		  
		  result.setTotalPrice(instance.getTotalPrice());
		  result.setDescription(instance.getDescription());
		  
		  /*
			private Long courseSeriesId;
		   * 
		   */
		  
		  
		  return result;
	  }
	  
	  public static CourseSeries prepareCourseSeries(CourseSeries result, WebServiceCourseSeries instance)
	  {
		  //We do not set the Id by default
		  //result.setId(instance.getId());
//		  result.setCategory(prepareCategory(instance.getWebServiceCategory()));
		  result.setName(instance.getName());
		  result.setLevel(instance.getLevel());
		  result.setCourseNumber(instance.getCourseNumber());
		  
//		  result.setTeacher(prepareTeacher(instance.getWebServiceTeacher()));
		  result.setCapacity(instance.getCapacity());
		  result.setOccupyNum(instance.getOccupyNum());
		  result.setStartDate(instance.getStartDate());
		  result.setEndDate(instance.getEndDate());
		  
		  result.setLastModified(instance.getLastModified());
		  result.setScore(instance.getScore());
		  result.setScoredNumber(instance.getScoredNumber());
		  result.setIsActived(instance.getIsActived());
		  result.setAttribute0(instance.getAttribute0());
		  
		  result.setTotalPrice(instance.getTotalPrice());
		  result.setDescription(instance.getDescription());
		  
		  return result;
	  }
	  
	  
	  public static WebServiceCustomer prepareWebCustomer(Customer instance)
	  {
		  WebServiceCustomer result = new WebServiceCustomer();
		  
		  result.setId(instance.getId());
		  result.setName(instance.getName());
		  result.setEmail(instance.getEmail());
		  result.setMobilePhone(instance.getMobilePhone());
		  result.setPassword(instance.getPassword());
		  
		  result.setLevel(instance.getLevel());
		  result.setThumbnail(instance.getThumbnail());
		  result.setBirthday(instance.getBirthday());
		  result.setAddress(instance.getAddress());
		  result.setZipCode(instance.getZipCode());
		  
		  result.setCouresHours(instance.getCouresHours());
		  result.setIsActived(instance.getIsActived());
		  result.setTotalCourseNumber(instance.getTotalCourseNumber());
		  
		  result.setIsTestFinished(instance.getIsTestFinished());
		  result.setLastAccesseDate(instance.getLastAccesseDate());
		  
		  result.setLastCourseDate(instance.getLastCourseDate());
		  
		  result.setDescription(instance.getDescription());
		  result.setAccountId(instance.getAccountId());

		  
		  
		  return result;
	  }
	  
	  public static Customer prepareCustomer(Customer result, WebServiceCustomer instance)
	  {
		  //We do not set the Id by default
		  //result.setId(instance.getId());
		  result.setName(instance.getName());
		  result.setEmail(instance.getEmail());
		  result.setMobilePhone(instance.getMobilePhone());
		  result.setPassword(instance.getPassword());
		  result.setLevel(instance.getLevel());
		  
		  result.setThumbnail(instance.getThumbnail());
		  result.setBirthday(instance.getBirthday());
		  
		  result.setAddress(instance.getAddress());
		  result.setZipCode(instance.getZipCode());
		  result.setCouresHours(instance.getCouresHours());
		  result.setIsActived(instance.getIsActived());
		  
		  result.setTotalCourseNumber(instance.getTotalCourseNumber());
		  
		  result.setIsTestFinished(instance.getIsTestFinished());
		  result.setLastAccesseDate(instance.getLastAccesseDate());
		  
		  result.setLastCourseDate(instance.getLastCourseDate());
		  
		  result.setDescription(instance.getDescription());
		  result.setAccountId(instance.getAccountId());
		  return result;
	  }
	  
	  
	  public static WebServiceCourseFile prepareWebCourseFile(CourseFile instance)
	  {
		  WebServiceCourseFile result = new WebServiceCourseFile();
		  result.setId(instance.getId());
		  result.setCourseId(instance.getCourseId());
		  result.setCourseSeriesId(instance.getCourseSeriesId());
		  result.setName(instance.getName());
		  result.setType(instance.getType());
		  
		  result.setFileName(instance.getFileName());
		  result.setVersion(instance.getVersion());

		  result.setDescription(instance.getDescription());
		  result.setUploadDate(instance.getUploadDate());
		  
		  /*
			private Long courseSeriesId;
		   * 
		   */
		  
		  
		  return result;
	  }
	  
	  public static CourseFile prepareCourseFile(CourseFile result, WebServiceCourseFile instance)
	  {
		  //We do not set the Id by default
		  //result.setId(instance.getId());
		  result.setCourseId(instance.getCourseId());
		  result.setCourseSeriesId(instance.getCourseSeriesId());
		  result.setName(instance.getName());
		  result.setType(instance.getType());
		  
		  result.setFileName(instance.getFileName());
		  result.setVersion(instance.getVersion());

		  result.setDescription(instance.getDescription());
		  result.setUploadDate(instance.getUploadDate());
		  
		  return result;
	  }
	  
	  
	  public static WebServiceCourseNews prepareWebCourseNews(CourseNews instance)
	  {
		  WebServiceCourseNews result = new WebServiceCourseNews();
		  result.setId(instance.getId());
		  result.setCourseId(instance.getCourseId());
		  result.setCourseSeriesId(instance.getCourseSeriesId());
		  result.setName(instance.getName());
		  result.setType(instance.getType());
		  
		  result.setFileName(instance.getFileName());
		  result.setVersion(instance.getVersion());

		  result.setDescription(instance.getDescription());
		  result.setCreateDate(instance.getCreateDate());
		  
		  /*
			private Long courseSeriesId;
		   * 
		   */
		  
		  
		  return result;
	  }
	  
	  public static CourseNews prepareCourseNews(CourseNews result, WebServiceCourseNews instance)
	  {
		  //We do not set the Id by default
		  //result.setId(instance.getId());
		  result.setCourseId(instance.getCourseId());
		  result.setCourseSeriesId(instance.getCourseSeriesId());
		  result.setName(instance.getName());
		  result.setType(instance.getType());
		  
		  result.setFileName(instance.getFileName());
		  result.setVersion(instance.getVersion());

		  result.setDescription(instance.getDescription());
		  result.setCreateDate(instance.getCreateDate());
		  
		  return result;
	  }
	  
	  
	  public static WebServiceUserComment prepareWebUserComment(UserComment instance)
	  {
		  WebServiceUserComment result = new WebServiceUserComment();
		  result.setId(instance.getId());
		  result.setCourseId(instance.getCourseId());
		  result.setCourseSeriesId(instance.getCourseSeriesId());
		  result.setTeacherId(instance.getTeacherId());
		  result.setType(instance.getType());
		  result.setLevel(instance.getLevel());
		  
		  result.setTopic(instance.getTopic());
		  result.setContent(instance.getContent());
		  result.setDate(instance.getDate());

		  result.setCustomerId(instance.getCustomer().getId());
		  
		  /*
			private Long courseSeriesId;
		   * 
		   */
		  
		  
		  return result;
	  }
	  
	  public static UserComment prepareUserComment(UserComment result, WebServiceUserComment instance)
	  {
		  //We do not set the Id by default
		  //result.setId(instance.getId());
		  result.setCourseId(instance.getCourseId());
		  result.setCourseSeriesId(instance.getCourseSeriesId());
		  result.setTeacherId(instance.getTeacherId());
		  result.setType(instance.getType());
		  result.setLevel(instance.getLevel());
		  
		  result.setTopic(instance.getTopic());
		  result.setContent(instance.getContent());
		  result.setDate(instance.getDate());

		  
		  return result;
	  }
	  
	  
	  public static WebServiceUserCourseSeries prepareWebUserCourseSeries(UserCourseSeries instance)
	  {
		  WebServiceUserCourseSeries result = new WebServiceUserCourseSeries();
		  
		  result.setId(instance.getId());
		  result.setCourseSeriesId(instance.getCourseSeriesId());
		  result.setName(instance.getName());
		  result.setType(instance.getType());
		  result.setLevel(instance.getLevel());
		  
		  result.setTeacherId(instance.getTeacherId());
		  result.setTeacherName(instance.getTeacherName());
		  result.setCapacity(instance.getCapacity());
		  result.setDescription(instance.getDescription());
		  result.setStartDate(instance.getStartDate());
		  result.setEndDate(instance.getEndDate());
		  
		  result.setLastModified(instance.getLastModified());
		  
		  result.setTotalPrice(instance.getTotalPrice());
		  result.setCustomerId(instance.getCustomer().getId());
		  
		  
		  /*
			private Long courseSeriesId;
		   * 
		   */
		  
		  
		  return result;
	  }
	  
	  public static UserCourseSeries prepareUserCourseSeries(UserCourseSeries result, WebServiceUserCourseSeries instance)
	  {
		  //We do not set the Id by default
		  //result.setId(instance.getId());
		  result.setCourseSeriesId(instance.getCourseSeriesId());
		  result.setName(instance.getName());
		  result.setType(instance.getType());
		  result.setLevel(instance.getLevel());
		  
		  result.setTeacherId(instance.getTeacherId());
		  result.setTeacherName(instance.getTeacherName());
		  result.setCapacity(instance.getCapacity());
		  result.setDescription(instance.getDescription());
		  result.setStartDate(instance.getStartDate());
		  result.setEndDate(instance.getEndDate());
		  
		  result.setLastModified(instance.getLastModified());
		  
		  result.setTotalPrice(instance.getTotalPrice());
		  
		  return result;
	  }

	  
	  public static WebServiceUserHistoryCourse prepareWebUserHistoryCourse(UserHistoryCourse instance)
	  {
		  WebServiceUserHistoryCourse result = new WebServiceUserHistoryCourse();
		  result.setId(instance.getId());
		  result.setCourseId(instance.getCourseId());
		  result.setCourseSeriesId(instance.getCourseSeriesId());
		  result.setChapterId(instance.getChapterId());
		  result.setName(instance.getName());
		  
		  result.setType(instance.getType());
		  result.setLevel(instance.getLevel());
		  result.setPayFactor(instance.getPayFactor());
		  result.setTeacherId(instance.getTeacherId());
		  result.setTeacherName(instance.getTeacherName());
		  
		  result.setTopic(instance.getTopic());
		  result.setDescription(instance.getDescription());
		  result.setCapacity(instance.getCapacity());
		  result.setDate(instance.getDate());
		  result.setDurationFactor(instance.getDurationFactor());
		  
		  result.setLastModified(instance.getLastModified());
		  result.setCourseScore(instance.getCourseScore());
		  
		  result.setTeacherScore(instance.getTeacherScore());
		  result.setIsCommented(instance.getIsCommented());
		  
		  result.setCustomerId(instance.getCustomer().getId());
		  /*
			private Long courseSeriesId;
		   * 
		   */
		  return result;
	  }
	  
	  public static UserHistoryCourse prepareUserHistoryCourse(UserHistoryCourse result, WebServiceUserHistoryCourse instance)
	  {
		  //We do not set the Id by default
		  //result.setId(instance.getId());
		  result.setCourseId(instance.getCourseId());
		  result.setCourseSeriesId(instance.getCourseSeriesId());
		  result.setChapterId(instance.getChapterId());
		  result.setName(instance.getName());
		  result.setType(instance.getType());
		  result.setLevel(instance.getLevel());
		  result.setPayFactor(instance.getPayFactor());
		  result.setTeacherId(instance.getTeacherId());
		  result.setTeacherName(instance.getTeacherName());
		  result.setTopic(instance.getTopic());
		  result.setDescription(instance.getDescription());
		  
		  result.setCapacity(instance.getCapacity());
		  result.setDate(instance.getDate());
		  result.setDurationFactor(instance.getDurationFactor());
		  result.setLastModified(instance.getLastModified());
		  result.setCourseScore(instance.getCourseScore());
		  
		  result.setTeacherScore(instance.getTeacherScore());
		  result.setIsCommented(instance.getIsCommented());
		  
		  return result;
	  }
	  
	  
	  public static WebServiceUserPlannedCourse prepareWebUserPlannedCourse(UserPlannedCourse instance)
	  {
		  WebServiceUserPlannedCourse result = new WebServiceUserPlannedCourse();
		  result.setId(instance.getId());
		  result.setCourseId(instance.getCourseId());
		  result.setCourseSeriesId(instance.getCourseSeriesId());
		  result.setChapterId(instance.getChapterId());
		  result.setName(instance.getName());
		  
		  result.setType(instance.getType());
		  result.setLevel(instance.getLevel());
		  result.setPayFactor(instance.getPayFactor());
		  result.setTeacherId(instance.getTeacherId());
		  result.setTeacherName(instance.getTeacherName());
		  
		  result.setTopic(instance.getTopic());
		  result.setDescription(instance.getDescription());
		  result.setCapacity(instance.getCapacity());
		  result.setDate(instance.getDate());
		  result.setDurationFactor(instance.getDurationFactor());
		  
		  result.setLastModified(instance.getLastModified());
		 
		  
		  result.setCustomerId(instance.getCustomer().getId());
		  /*
			private Long courseSeriesId;
		   * 
		   */
		  return result;
	  }
	  
	  public static UserPlannedCourse prepareUserPlannedCourse(UserPlannedCourse result, WebServiceUserPlannedCourse instance)
	  {
		  //We do not set the Id by default
		  //result.setId(instance.getId());
		  result.setCourseId(instance.getCourseId());
		  result.setCourseSeriesId(instance.getCourseSeriesId());
		  result.setChapterId(instance.getChapterId());
		  result.setName(instance.getName());
		  
		  result.setType(instance.getType());
		  result.setLevel(instance.getLevel());
		  result.setPayFactor(instance.getPayFactor());
		  result.setTeacherId(instance.getTeacherId());
		  result.setTeacherName(instance.getTeacherName());
		  
		  result.setTopic(instance.getTopic());
		  result.setDescription(instance.getDescription());
		  result.setCapacity(instance.getCapacity());
		  result.setDate(instance.getDate());
		  result.setDurationFactor(instance.getDurationFactor());
		  
		  result.setLastModified(instance.getLastModified());
		 
		  
		  return result;
	  }
	  
    
    
    
    
}
